#!/bin/bash

echo "开始安装 Gazebo 11..."

# 更新系统包列表
echo "更新系统包列表..."
sudo apt update

# 安装 Gazebo 11 核心包
echo "安装 Gazebo 11 核心包..."
sudo apt install -y gazebo11

# 安装 Gazebo 11 开发包
echo "安装 Gazebo 11 开发包..."
sudo apt install -y libgazebo11-dev

# 安装 Gazebo 11 插件
echo "安装 Gazebo 11 插件..."
sudo apt install -y gazebo11-plugins gazebo11-plugins-base gazebo11-plugins-extra

# 安装额外的依赖
echo "安装额外依赖..."
sudo apt install -y build-essential cmake libfreeimage-dev libprotoc-dev protobuf-compiler libprotobuf-dev libboost-all-dev freeglut3-dev libogre-1.9-dev libtar-dev libcurl4-openssl-dev libtbb-dev

echo "Gazebo 11 安装完成！"

# 验证安装
echo "验证安装..."
gazebo --version

echo "安装完成！现在可以测试 Gazebo 了。"
echo "运行 'gazebo' 启动 Gazebo"
echo "运行 'make px4_sitl gazebo_iris_opt_flow' 测试 PX4 仿真"
